public class EXAMPIE01AND02 {
    public static void main(String[] args) {
            File file1 = new File("D:\\file\\a.txt");
            File file2 = new File("src:\\file\\Hello.java");
            System.out.println(file1);
            System.out.println(file2);

            System.out.println("当前文件对象对应的文件路径是否存在:" + file1.exists());
            System.out.println("当前文件对象对应的绝对路径是否是文件:" + file1.isFile());
            System.out.println("当前文件对象代指的文件或目录是否为绝对路径:" + file1.isAbsolute());
            System.out.println("文件名称" + file1.getName());
            System.out.println("文件大小:" + file1.length() + "bytes");
            System.out.println("文件的绝对路径:" + file1.getPath());
            System.out.println("文件的绝对路径:" + file1.getAbsolutePath());
        }
    }
}
